package com.ruoyi.system.service.impl;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.system.domain.CameraValueData;
import com.ruoyi.system.mapper.CameraValueDataMapper;
import com.ruoyi.system.service.ICameraValueDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 摄像头Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-10-01
 */
@Service
@DataSource(value = DataSourceType.SLAVE)
public class CameraValueDataServiceImpl implements ICameraValueDataService 
{
    @Autowired
    private CameraValueDataMapper cameraValueDataMapper;

    /**
     * 查询摄像头
     * 
     * @param deviceId 摄像头主键
     * @return 摄像头
     */
    @Override
    public CameraValueData selectCameraValueDataByDeviceId(Integer deviceId)
    {
        return cameraValueDataMapper.selectCameraValueDataByDeviceId(deviceId);
    }

    /**
     * 查询摄像头列表
     * 
     * @param cameraValueData 摄像头
     * @return 摄像头
     */
    @Override
    public List<CameraValueData> selectCameraValueDataList(CameraValueData cameraValueData)
    {
        return cameraValueDataMapper.selectCameraValueDataList(cameraValueData);
    }

    /**
     * 新增摄像头
     * 
     * @param cameraValueData 摄像头
     * @return 结果
     */
    @Override
    public int insertCameraValueData(CameraValueData cameraValueData)
    {
        return cameraValueDataMapper.insertCameraValueData(cameraValueData);
    }

    /**
     * 修改摄像头
     * 
     * @param cameraValueData 摄像头
     * @return 结果
     */
    @Override
    public int updateCameraValueData(CameraValueData cameraValueData)
    {
        return cameraValueDataMapper.updateCameraValueData(cameraValueData);
    }

    /**
     * 批量删除摄像头
     * 
     * @param deviceIds 需要删除的摄像头主键
     * @return 结果
     */
    @Override
    public int deleteCameraValueDataByDeviceIds(String deviceIds)
    {
        return cameraValueDataMapper.deleteCameraValueDataByDeviceIds(Convert.toStrArray(deviceIds));
    }

    /**
     * 删除摄像头信息
     * 
     * @param deviceId 摄像头主键
     * @return 结果
     */
    @Override
    public int deleteCameraValueDataByDeviceId(Integer deviceId)
    {
        return cameraValueDataMapper.deleteCameraValueDataByDeviceId(deviceId);
    }
}
